package urban_seed_cn

import (
	"fmt"
	"gitee.com/theegg/go-brick/app/model/urban/urban_elements"
	"gitee.com/theegg/go-brick/app/service/app"
)

// 饭店 seed
func InitPartnerRestaurantElementsSeed() {

	items := make(map[int]urban_elements.UrbanElements)

	items[1200001] = urban_elements.UrbanElements{
		Id:          1200001,
		PartnerSign: "default",
		Lang:        "cn",
		Title:       "马祥兴菜馆宴会厅",
		TitleEn:     "Ma xiang xing",
		TypeId:      2,
		TypeSubId:   2010,
		Summary:     "金陵“马祥兴”字号，自1845年清朝道光年间传至今日，已160余载。历尽世事沧桑，遍尝人生百味而不改。创业伊始，马祥兴菜馆即融北方清真风味之典藏密芨与江南食材佳肴为一炉，恬淡清雅、口齿流香，堪称清真回食南方派之翘楚。",
		Content:     "",

		OpenTime:    "11:00",
		CloseTime:   "22:00",
		OpenWeekDay: "1,2,3,4,5,6,7",

		Phone: "025-83286387",

		Tags: "干净卫生,服务极好,价格合理",

		Country:    "cn",
		ProvinceId: 2002,
		CityId:     2002001,
		Address:    "江苏省南京市鼓楼区云南北路32号",

		CoordinateX: "13223231.77",
		CoordinateY: "3749957.75",
		PlusCode:    "",

		ImageCover: "",
		ImageList:  "",

		ImageCount:  0,
		ViewCount:   0,
		IsHot:       false,
		IsRecommend: false,
		Status:      1,
	}

	items[1200002] = urban_elements.UrbanElements{
		Id:          1200002,
		PartnerSign: "default",
		Lang:        "cn",
		Title:       "洲际酒店里瓦地中海扒房",
		TitleEn:     "Hong Pa",
		TypeId:      2,
		TypeSubId:   2007,
		Summary:     "适宜情侣约会、家庭聚会、商务宴请、朋友聚餐",
		Content:     "",

		OpenTime:    "10:00",
		CloseTime:   "03:00",
		OpenWeekDay: "1,2,3,4,5,6,7",

		Phone: "",

		Tags: "干净卫生,服务极好,价格合理",

		Country:    "cn",
		ProvinceId: 2002,
		CityId:     2002002,
		Address:    "江苏省苏州市苏州工业园区旺墩路288号洲际酒店2楼",

		CoordinateX: "13438135.67",
		CoordinateY: "3652717.17",
		PlusCode:    "",

		ImageCover: "",
		ImageList:  "",

		ImageCount:  0,
		ViewCount:   0,
		IsHot:       false,
		IsRecommend: false,
		Status:      1,
	}

	count := 0
	errCount := 0
	for _, item := range items {
		_, err := app.Db().Insert(item)
		if err != nil {
			fmt.Println(err.Error())
			errCount++
		} else {
			count++
		}
	}

	fmt.Printf("%5s|%25s|%10d|%8d|\n", "", "urban_elements", count, errCount)
}
